﻿using HuiLian.Common.Auth;
using HuiLian.Common.Configs;
using HuiLian.Common.Helpers;
using HuiLian.Common.Input;
using HuiLian.Common.Output;
using HuiLian.Model.Platform;
using HuiLian.Service.Platform.MeasureInfo;
using HuiLian.Service.Platform.PipeTeZhengData;
using HuiLian.Service.Platform.PipeTeZhengData.Input;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using System.Threading.Tasks;

namespace HuiLian.Web.Controllers.Platform
{
    /// <summary>
    /// 管网特征数据库管理
    /// </summary>
    public class PipeTeZhengDataController : AreaController
    {
        private readonly IPipeTeZhengDataService _pipeTeZhengDataServices;

        public PipeTeZhengDataController(IPipeTeZhengDataService pipeTeZhengDataServices)
        {
            _pipeTeZhengDataServices = pipeTeZhengDataServices;
        }

        /// <summary>
        /// 查询分页测量数据表
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<IResponseOutput> GetPage(PageInput<PipeEntity> model)
        {
            return await _pipeTeZhengDataServices.PageAsync(model);
        }

        /// <summary>
        /// 操作历史数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<IResponseOutput> OperationData(OperationDataInput input)
        {
            return await _pipeTeZhengDataServices.OperationData(input);
        }

        /// <summary>
        /// 统计各个健康级别的管线数量和管线长度
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<IResponseOutput> StatisticsPipe(StatisticsPipeInput input)
        {
            return await _pipeTeZhengDataServices.StatisticsPipe(input);
        }
    }
}
